// 剩余电费记录表
const logs = [
    ['2021-07-25', 208],
    ['2021-08-19', 109],
    ['2021-09-02 22:21', 88.32],
    ['2021-09-02 22:22', 288.32],
    ['2021-12-13 13:07', 284],
    ['2022-02-14 11:42', 110.93],
    ['2022-03-06 18:49', 52.82],
    ['2022-03-06 18:57', 252.82],
    ['2022-04-21 20:44', 148],
    ['2022-05-05 23:07', 115],
    ['2022-05-10 09:53', 204.87],
    ['2022-06-18 11:46', 210],
    ['2022-07-02 21:55', 163.82],
    ['2022-07-13 14:19', 333.39],
    ['2022-08-14 12:57', 136.57],
];

const myChart = echarts.init(document.querySelector('#main'))
const option = {
    title: { text: '剩余电费' },
    tooltip: {
        trigger: 'axis',
        position: function(pt) {
            return [pt[0], '10%']
        }
    },
    legend: { data: ['电费'] },
    xAxis: {
        type: 'time',
    },
    yAxis: {},
    series: [
        {
            name: '电费',
            type: 'line',
            data: logs
        }
    ],
}
myChart.setOption(option)
